package com.yboot.starter.common.config;

import com.yboot.starter.common.core.security.DefaultUserContext;
import com.yboot.starter.common.core.security.UserContext;
import com.yboot.starter.common.core.web.jackson.JacksonConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.core.Ordered;

/**
 * 功能描述
 *
 * @author yangcs
 * @date 2025/8/15
 */
@Configuration
@Import(JacksonConfiguration.class)
public class CoreMissBeanConfiguration implements Ordered {

    @Bean
    @ConditionalOnMissingBean
    public UserContext userContext() {
        return new DefaultUserContext();
    }

    @Override
    public int getOrder() {
        return Ordered.LOWEST_PRECEDENCE;
    }
}
